package com.itao.springboot.controller;

import lombok.Data;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sjt
 * @Date 2025/6/23 14:52
 */
@RestController
public class TengLingController {

    @PostMapping(value = "/tl")
    public R tl(@RequestBody TlParam tlParam) {
        System.out.println(tlParam);
        return R.ok(new TengLing());
    }


    @Data
    static class R {

        private String error;
        private Object response;

        public R(String error, Object response) {
            this.error = error;
            this.response = response;
        }

        public static R ok(Object response) {
            return new R(null, response);
        }
    }

    @Data
    static class TengLing {


        private int disknums;
        private int disknums_used;
        private String diskcapacity;
        private String diskcapacity_used;
        private String poolcapacity;
        private String poolcapacity_used;
        private int sysdiskcapacity;
        private int sysdiskcapacity_used;


        public TengLing() {
            this.disknums = 10;
            this.disknums_used = 6;
            this.diskcapacity = "40.48 TB";
            this.diskcapacity_used = "20.48 TB";
            this.poolcapacity = "17172111360";
            this.poolcapacity_used = "14680064";
            this.sysdiskcapacity = 1498976;
            this.sysdiskcapacity_used = 441236;
        }
    }

    @Data
    public static class TlParam {

        private String service;
        private String method;
    }
}
